import store from '@/store';

export default {
    install(Vue) {
        // 隐藏无权限按钮 v-if="routerShow($route, '接口对应字段')"
        Vue.prototype.routerShow = (route, name) => {
            if (route.meta && route.meta.permissionBtn) {
                return route.meta.permissionBtn.includes(name)
            }
            return false
        };
        // 隐藏无权限按钮2.0 v-if="routerShow( '接口对应字段')"
        // Vue.prototype.btnShow = (name) => {
        //     let permissionAll = store.state.permission.permissionAll
        //     if (permissionAll.length && typeof permissionAll != 'undefined') {
        //         console.log(11111111111111111, permissionAll.includes(name), permissionAll);
        //         return permissionAll.includes(name)
        //     }
        //     return false
        // };
    },
};
